from pydantic import BaseModel, Field
from typing import List, Optional
from app.schemas.storage import OssConfig


class EventDefect(BaseModel):
    event_target_text: Optional[str] = None
    target_num: Optional[int] = None
    level_text: Optional[str] = None
    location: Optional[str] = None


class NodeList(BaseModel):
    action_text: Optional[str] = None
    node_text: Optional[str] = None
    operate_time: Optional[str] = None
    origin_operate_time: Optional[str] = None
    has_next: bool
    operate_staff_name: Optional[str] = None
    sequence: Optional[int] = None
    remark: Optional[str] = None
    pic_list: Optional[List[str]] = None
    role_type: Optional[int] = None
    audit_result: Optional[str] = None
    audit_remark: Optional[str] = None


class WorkOrderReport(BaseModel):
    id: int
    title: str
    priority: int
    status: int
    apply_staff_name: str
    process_staff_name: str
    sequence: int
    remark: Optional[str] = None
    create_time: str
    media_file_urls: List[str]
    event_defect: EventDefect
    node_list: Optional[List[NodeList]] = None
    oss_config: OssConfig
    upload_callback_url: str
